package com.jackson.controll;

import com.jackson.dao.StudentDao;
import com.jackson.entity.StudentEntity;
import com.jackson.service.StudentService;

import java.sql.*;
import java.util.ArrayList;

/*
 * Author: JacksonCoder
 * FileName: JdbcExample
 * Version: 1.0.0
 */

public class JdbcExample {
    public static void main(String[] args) throws SQLException {
//        String url = "jdbc:mysql://localhost:3306/learnsql";
//        String user = "root";
//        String password = "123456";
//        StudentDao.connMysql(url, user, password);
        StudentService studentService = new StudentService();
        ArrayList<StudentEntity> studentEntities = studentService.allStudents();
        for(StudentEntity student : studentEntities){
            System.out.println(student);
        }
//        System.out.println(studentEntities);
    }
}
